package com.karry.pojo;

import java.util.Date;

/**
 *  评论类
 * **/
public class Comment {

    private int id;
    private int blogId;
    private int userId;
    private String text;
    //所属一级评论ID，如果本身是一级评论则为0
    private int fatherCommentId;
    //被回复用户ID，如果本身是一级评论则为0
    private int backUserId;
    private Date time;
    //以下两个变量是发送用户与被回复用户昵称，数据库对应表没有这两个字段，这样虽然麻烦点但是更合理
    private String userNick;
    private String backUserNick;
    //优化评论，增加一下几个变量
    //发表用户头像（数据库不加）
    private String userHead;
    //被回复用户发表的评论（前端显示效果更好）
    private String backCommentText;
    //标记字段（是否已经通知
    private int notify;
    //是否存在
    private int status;

    //没有那两个昵称
    public Comment(int id, int blogId, int userId, String text, int fatherCommentId, int backUserId, Date time) {
        this.id = id;
        this.blogId = blogId;
        this.userId = userId;
        this.text = text;
        this.fatherCommentId = fatherCommentId;
        this.backUserId = backUserId;
        this.time = time;
    }

    public Comment() {}

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public int getBlogId() {
        return blogId;
    }

    public void setBlogId(int blogId) {
        this.blogId = blogId;
    }

    public int getUserId() {
        return userId;
    }

    public void setUserId(int userId) {
        this.userId = userId;
    }

    public String getText() {
        return text;
    }

    public void setText(String text) {
        this.text = text;
    }

    public int getFatherCommentId() {
        return fatherCommentId;
    }

    public void setFatherCommentId(int fatherCommentId) {
        this.fatherCommentId = fatherCommentId;
    }

    public int getBackUserId() {
        return backUserId;
    }

    public void setBackUserId(int backUserId) {
        this.backUserId = backUserId;
    }

    public Date getTime() {
        return time;
    }

    public void setTime(Date time) {
        this.time = time;
    }

    public String getUserNick() {
        return userNick;
    }

    public void setUserNick(String userNick) {
        this.userNick = userNick;
    }

    public String getBackUserNick() {
        return backUserNick;
    }

    public void setBackUserNick(String backUserNick) {
        this.backUserNick = backUserNick;
    }

    public String getUserHead() {
        return userHead;
    }

    public void setUserHead(String userHead) {
        this.userHead = userHead;
    }

    public String getBackCommentText() {
        return backCommentText;
    }

    public void setBackCommentText(String backCommentText) {
        this.backCommentText = backCommentText;
    }

    public int getNotify() {
        return notify;
    }

    public void setNotify(int notify) {
        this.notify = notify;
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    @Override
    public String toString() {
        return "Comment{" +
                "id=" + id +
                ", blogId=" + blogId +
                ", userId=" + userId +
                ", text='" + text + '\'' +
                ", fatherCommentId=" + fatherCommentId +
                ", backUserId=" + backUserId +
                ", time=" + time +
                ", userNick='" + userNick + '\'' +
                ", backUserNick='" + backUserNick + '\'' +
                ", userHead='" + userHead + '\'' +
                ", backCommentText='" + backCommentText + '\'' +
                ", notify=" + notify +
                ", status=" + status +
                '}';
    }
}
